home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 10 / BBS In A Box Volume X (AMUG) (January 1994).bin / Files / Prog / U-Z / VideoToolBox.cpt / VideoToolboxSources / RestoreCluts.c < prev    next >
MacBinary  |  1993-02-22  |  2.4 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Feb 22 22:20:38 1993, modified Mon Feb 22 22:20:38 1993, creator Think C, type ASCII, 1659 bytes "RestoreCluts.c" , at 0x6fb 514 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 52 65 73 74 6f 72 | 65 43 6c 75 74 73 2e 63 |..Restor|eCluts.c|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 06 7b 00 | 00 02 02 a7 af 48 86 a7 |......{.|.....H..|
|00000060| af 48 86 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.H......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 5e e9 00 00 |........|....^...|
|00000080| 2f 2a 0d 52 65 73 74 6f | 72 65 43 6c 75 74 73 2e |/*.Resto|reCluts.|
|00000090| 63 0d 44 65 76 65 6c 6f | 70 69 6e 67 20 70 72 6f |c.Develo|ping pro|
|000000a0| 67 72 61 6d 73 20 74 68 | 61 74 20 6d 6f 64 69 66 |grams th|at modif|
|000000b0| 79 20 74 68 65 20 63 6c | 75 74 20 63 61 6e 20 62 |y the cl|ut can b|
|000000c0| 65 20 61 6e 6e 6f 79 69 | 6e 67 2c 20 62 65 63 61 |e annoyi|ng, beca|
|000000d0| 75 73 65 20 6f 6e 65 20 | 66 72 65 71 75 65 6e 74 |use one |frequent|
|000000e0| 6c 79 0d 61 62 6f 72 74 | 73 20 74 68 65 20 70 72 |ly.abort|s the pr|
|000000f0| 6f 67 72 61 6d 20 66 6f | 72 20 6f 6e 65 20 72 65 |ogram fo|r one re|
|00000100| 61 73 6f 6e 20 6f 72 20 | 61 6e 6f 74 68 65 72 20 |ason or |another |
|00000110| 61 6e 64 20 74 68 65 6e | 20 66 61 63 65 73 20 61 |and then| faces a|
|00000120| 6e 20 65 64 69 74 69 6e | 67 20 65 6e 76 69 72 6f |n editin|g enviro|
|00000130| 6e 6d 65 6e 74 0d 69 6e | 20 77 68 69 63 68 20 74 |nment.in| which t|
|00000140| 65 78 74 20 69 73 20 68 | 61 72 64 20 74 6f 20 73 |ext is h|ard to s|
|00000150| 65 65 20 62 65 63 61 75 | 73 65 20 6f 66 20 74 68 |ee becau|se of th|
|00000160| 65 20 77 65 69 72 64 20 | 63 6c 75 74 20 73 65 74 |e weird |clut set|
|00000170| 74 69 6e 67 73 2e 20 4e | 6f 20 6c 6f 6e 67 65 72 |tings. N|o longer|
|00000180| 2e 0d 0d 53 6f 6d 65 77 | 68 65 72 65 20 6e 65 61 |...Somew|here nea|
|00000190| 72 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 20 |r the be|ginning |
|000001a0| 6f 66 20 79 6f 75 72 20 | 70 72 6f 67 72 61 6d 20 |of your |program |
|000001b0| 69 6e 73 65 72 74 20 74 | 68 65 20 6c 69 6e 65 3a |insert t|he line:|
|000001c0| 0d 0d 5f 61 74 65 78 69 | 74 28 52 65 73 74 6f 72 |.._atexi|t(Restor|
|000001d0| 65 43 6c 75 74 73 29 3b | 0d 0d 54 68 69 73 20 74 |eCluts);|..This t|
|000001e0| 65 6c 6c 73 20 74 68 65 | 20 54 48 49 4e 4b 20 43 |ells the| THINK C|
|000001f0| 20 72 75 6e 74 69 6d 65 | 20 65 6e 76 69 72 6f 6e | runtime| environ|
|00000200| 6d 65 6e 74 20 74 6f 20 | 72 75 6e 20 52 65 73 74 |ment to |run Rest|
|00000210| 6f 72 65 43 6c 75 74 73 | 28 29 20 61 74 20 65 78 |oreCluts|() at ex|
|00000220| 69 74 2c 20 65 76 65 6e | 20 69 66 0d 69 74 27 73 |it, even| if.it's|
|00000230| 20 61 6e 20 61 62 6e 6f | 72 6d 61 6c 20 65 78 69 | an abno|rmal exi|
|00000240| 74 2c 20 65 2e 67 2e 20 | 65 73 63 61 70 65 20 74 |t, e.g. |escape t|
|00000250| 6f 20 73 68 65 6c 6c 20 | 66 72 6f 6d 20 4d 61 63 |o shell |from Mac|
|00000260| 73 42 75 67 2e 0d 0d 43 | 41 55 54 49 4f 4e 3a 20 |sBug...C|AUTION: |
|00000270| 74 68 65 20 61 74 65 78 | 69 74 28 29 20 61 6e 64 |the atex|it() and|
|00000280| 20 5f 61 74 65 78 69 74 | 28 29 20 72 6f 75 74 69 | _atexit|() routi|
|00000290| 6e 65 73 20 70 72 6f 62 | 61 62 6c 79 20 73 68 6f |nes prob|ably sho|
|000002a0| 75 6c 64 20 6e 6f 74 20 | 62 65 20 75 73 65 64 20 |uld not |be used |
|000002b0| 69 6e 0d 4d 41 54 4c 41 | 42 20 63 6f 64 65 20 72 |in.MATLA|B code r|
|000002c0| 65 73 6f 75 72 63 65 73 | 2e 20 54 68 65 20 72 65 |esources|. The re|
|000002d0| 61 73 6f 6e 20 69 73 20 | 74 68 61 74 20 74 68 65 |ason is |that the|
|000002e0| 79 20 77 69 6c 6c 20 6f | 6e 6c 79 20 62 65 20 69 |y will o|nly be i|
|000002f0| 6e 76 6f 6b 65 64 20 77 | 68 65 6e 20 4d 61 74 4c |nvoked w|hen MatL|
|00000300| 61 62 0d 65 78 69 74 73 | 2c 20 61 66 74 65 72 20 |ab.exits|, after |
|00000310| 79 6f 75 72 20 63 6f 64 | 65 20 72 65 73 6f 75 72 |your cod|e resour|
|00000320| 63 65 73 20 68 61 76 65 | 20 61 6c 72 65 61 64 79 |ces have| already|
|00000330| 20 62 65 65 6e 20 66 6c | 75 73 68 65 64 2c 20 73 | been fl|ushed, s|
|00000340| 6f 20 79 6f 75 27 6c 6c | 20 63 72 61 73 68 2e 0d |o you'll| crash..|
|00000350| 0d 46 6f 72 20 72 65 61 | 73 6f 6e 73 20 74 68 61 |.For rea|sons tha|
|00000360| 74 20 49 20 64 6f 6e 27 | 74 20 75 6e 64 65 72 73 |t I don'|t unders|
|00000370| 74 61 6e 64 2c 20 41 70 | 70 6c 65 27 73 20 52 65 |tand, Ap|ple's Re|
|00000380| 73 74 6f 72 65 44 65 76 | 69 63 65 43 6c 75 74 20 |storeDev|iceClut |
|00000390| 64 6f 65 73 6e 27 74 20 | 73 65 65 6d 20 74 6f 20 |doesn't |seem to |
|000003a0| 0d 64 6f 20 61 6e 79 74 | 68 69 6e 67 2c 20 65 76 |.do anyt|hing, ev|
|000003b0| 65 6e 20 74 68 6f 75 67 | 68 20 6d 79 20 47 44 52 |en thoug|h my GDR|
|000003c0| 65 73 74 6f 72 65 44 65 | 76 69 63 65 43 6c 75 74 |estoreDe|viceClut|
|000003d0| 20 77 6f 72 6b 73 20 66 | 69 6e 65 2e 0d 0d 48 49 | works f|ine...HI|
|000003e0| 53 54 4f 52 59 3a 0d 34 | 2f 32 35 2f 39 32 20 64 |STORY:.4|/25/92 d|
|000003f0| 67 70 09 77 72 6f 74 65 | 20 69 74 2e 20 57 68 79 |gp.wrote| it. Why|
|00000400| 20 64 69 64 6e 27 74 20 | 49 20 74 68 69 6e 6b 20 | didn't |I think |
|00000410| 6f 66 20 74 68 69 73 20 | 73 6f 6f 6e 65 72 3f 0d |of this |sooner?.|
|00000420| 31 32 2f 38 2f 39 32 20 | 64 67 70 20 73 69 6d 70 |12/8/92 |dgp simp|
|00000430| 6c 69 66 69 65 64 20 63 | 6f 64 65 2c 20 62 61 73 |lified c|ode, bas|
|00000440| 65 64 20 6f 6e 20 41 70 | 70 6c 65 27 73 20 53 6e |ed on Ap|ple's Sn|
|00000450| 69 70 70 65 74 3a 20 0d | 09 09 09 52 65 73 74 6f |ippet: .|...Resto|
|00000460| 72 65 43 6f 6c 6f 72 73 | 53 6c 61 6d 28 29 20 69 |reColors|Slam() i|
|00000470| 6e 20 43 6f 6c 6f 72 52 | 65 73 65 74 2e 63 2e 0d |n ColorR|eset.c..|
|00000480| 31 32 2f 39 2f 39 32 09 | 64 67 70 09 72 65 70 6c |12/9/92.|dgp.repl|
|00000490| 61 63 65 64 20 63 61 6c | 6c 20 74 6f 20 41 70 70 |aced cal|l to App|
|000004a0| 6c 65 27 73 20 52 65 73 | 74 6f 72 65 44 65 76 69 |le's Res|toreDevi|
|000004b0| 63 65 43 6c 75 74 20 62 | 79 20 6d 79 20 47 44 52 |ceClut b|y my GDR|
|000004c0| 65 73 74 6f 72 65 44 65 | 76 69 63 65 43 6c 75 74 |estoreDe|viceClut|
|000004d0| 2c 20 0d 09 09 09 73 69 | 6e 63 65 20 41 70 70 6c |, ....si|nce Appl|
|000004e0| 65 27 73 20 72 6f 75 74 | 69 6e 65 20 64 6f 65 73 |e's rout|ine does|
|000004f0| 6e 27 74 20 73 65 65 6d | 20 74 6f 20 64 6f 20 61 |n't seem| to do a|
|00000500| 6e 79 74 68 69 6e 67 2e | 0d 31 32 2f 31 35 2f 39 |nything.|.12/15/9|
|00000510| 32 20 64 67 70 20 52 65 | 6e 61 6d 65 64 20 74 6f |2 dgp Re|named to|
|00000520| 20 47 44 52 65 73 74 6f | 72 65 44 65 76 69 63 65 | GDResto|reDevice|
|00000530| 43 6c 75 74 20 66 6f 72 | 20 63 6f 6e 73 69 73 74 |Clut for| consist|
|00000540| 65 6e 74 63 79 20 77 69 | 74 68 0d 09 09 09 41 70 |entcy wi|th....Ap|
|00000550| 70 6c 65 27 73 20 63 61 | 70 69 74 61 6c 69 7a 61 |ple's ca|pitaliza|
|00000560| 74 69 6f 6e 20 6f 66 20 | 52 65 73 74 6f 72 65 44 |tion of |RestoreD|
|00000570| 65 76 69 63 65 43 6c 75 | 74 2e 0d 32 2f 32 32 2f |eviceClu|t..2/22/|
|00000580| 39 33 20 20 64 68 62 20 | 26 20 64 67 70 20 43 6f |93 dhb |& dgp Co|
|00000590| 6e 76 65 72 74 65 64 20 | 66 6f 72 20 4d 41 54 4c |nverted |for MATL|
|000005a0| 41 42 0d 2a 2f 0d 0d 23 | 69 6e 63 6c 75 64 65 20 |AB.*/..#|include |
|000005b0| 22 56 69 64 65 6f 54 6f | 6f 6c 62 6f 78 2e 68 22 |"VideoTo|olbox.h"|
|000005c0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 4d 65 6e 75 73 |.#includ|e <Menus|
|000005d0| 2e 68 3e 0d 0d 76 6f 69 | 64 20 52 65 73 74 6f 72 |.h>..voi|d Restor|
|000005e0| 65 43 6c 75 74 73 28 76 | 6f 69 64 29 0d 7b 0d 09 |eCluts(v|oid).{..|
|000005f0| 2f 2f 20 52 65 73 74 6f | 72 65 44 65 76 69 63 65 |// Resto|reDevice|
|00000600| 43 6c 75 74 28 4e 55 4c | 4c 29 3b 09 2f 2f 20 20 |Clut(NUL|L);.// |
|00000610| 41 70 70 6c 65 27 73 20 | 76 65 72 73 69 6f 6e 2c |Apple's |version,|
|00000620| 20 72 65 73 74 6f 72 65 | 20 61 6c 6c 20 63 6c 75 | restore| all clu|
|00000630| 74 73 0d 09 47 44 52 65 | 73 74 6f 72 65 44 65 76 |ts..GDRe|storeDev|
|00000640| 69 63 65 43 6c 75 74 28 | 4e 55 4c 4c 29 3b 09 2f |iceClut(|NULL);./|
|00000650| 2f 20 6d 79 20 76 65 72 | 73 69 6f 6e 2c 20 72 65 |/ my ver|sion, re|
|00000660| 73 74 6f 72 65 20 61 6c | 6c 20 63 6c 75 74 73 0d |store al|l cluts.|
|00000670| 09 2f 2f 20 41 70 70 6c | 65 20 73 75 67 67 65 73 |.// Appl|e sugges|
|00000680| 74 73 20 6d 61 6b 69 6e | 67 20 74 68 65 73 65 20 |ts makin|g these |
|00000690| 74 77 6f 20 63 61 6c 6c | 73 20 61 73 20 77 65 6c |two call|s as wel|
|000006a0| 6c 2c 20 74 6f 20 66 6f | 72 63 65 20 72 65 64 72 |l, to fo|rce redr|
|000006b0| 61 77 69 6e 67 20 6f 66 | 0d 09 2f 2f 20 65 76 65 |awing of|..// eve|
|000006c0| 72 79 74 68 69 6e 67 2e | 0d 09 50 61 69 6e 74 42 |rything.|..PaintB|
|000006d0| 65 68 69 6e 64 28 4e 55 | 4c 4c 2c 47 65 74 47 72 |ehind(NU|LL,GetGr|
|000006e0| 61 79 52 67 6e 28 29 29 | 3b 0d 09 44 72 61 77 4d |ayRgn())|;..DrawM|
|000006f0| 65 6e 75 42 61 72 28 29 | 3b 0d 7d 00 00 00 00 00 |enuBar()|;.}.....|
|00000700| 00 00 01 00 00 00 01 9c | 00 00 00 9c 00 00 00 66 |........|.......f|
|00000710| 00 00 02 fd 00 08 a7 30 | d7 99 00 00 25 70 00 00 |.......0|....%p..|
|00000720| 02 f7 00 08 a7 30 d7 99 | 00 00 25 76 00 00 02 bd |.....0..|..%v....|
|00000730| 0e 52 65 73 74 6f 72 65 | 43 6c 75 74 73 2e 63 6c |.Restore|Cluts.cl|
|00000740| 02 00 00 00 54 45 58 54 | 4b 41 48 4c 00 00 00 00 |....TEXT|KAHL....|
|00000750| 00 00 54 45 58 54 4b 41 | 48 4c 00 00 00 00 00 00 |..TEXTKA|HL......|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 a7 e5 d5 c9 00 00 | 00 00 00 00 02 02 25 91 |........|......%.|
|00000780| 00 00 02 bd 00 08 a7 30 | d7 9b 00 00 25 94 00 00 |.......0|....%...|
|00000790| 02 bd 00 08 a7 30 d7 9c | 00 00 05 84 00 00 02 bd |.....0..|........|
|000007a0| 00 08 a7 30 d7 9c 00 00 | 25 99 00 00 03 09 00 08 |...0....|%.......|
|000007b0| a7 30 d7 9c 00 00 25 a7 | 00 00 03 0a 00 08 a7 30 |.0....%.|.......0|
|000007c0| d7 9c 00 00 25 b0 00 00 | 03 09 00 08 a7 30 d7 9c |....%...|.....0..|
|000007d0| 00 00 25 bd 00 00 03 09 | 00 08 a7 30 d7 9c 00 00 |..%.....|...0....|
|000007e0| 25 c8 00 00 03 09 00 08 | a7 30 d7 9c 00 00 25 cb |%.......|.0....%.|
|000007f0| 00 00 03 0e 00 08 a7 30 | d7 9d 00 00 25 d6 00 00 |.......0|....%...|
|00000800| 00 00 00 0a 00 00 04 31 | ff ff 00 00 00 00 00 00 |.......1|........|
|00000810| 00 1c 00 01 00 1a 00 00 | 05 c5 00 25 00 5a d9 9c |........|...%.Z..|
|00000820| 00 00 0b 6d 79 47 44 48 | 61 6e 64 6c 65 20 00 00 |...myGDH|andle ..|
|00000830| 00 48 00 09 4d 6f 6e 61 | 63 6f 00 00 00 53 77 20 |.H..Mona|co...Sw |
|00000840| fc 19 00 00 00 00 00 00 | 01 68 01 29 00 09 01 29 |........|.h.)...)|
|00000850| 02 0e 00 00 00 06 00 04 | 00 5c 00 41 01 99 02 5e |........|.\.A...^|
|00000860| 00 5c 00 41 01 99 02 5e | a7 ac 93 f5 00 00 04 15 |.\.A...^|........|
|00000870| 00 00 04 15 00 00 01 ac | 01 00 00 00 00 1e 00 5c |........|.......\|
|00000880| 00 41 01 99 02 5e 00 5c | 00 41 01 99 02 5e 00 00 |.A...^.\|.A...^..|
|00000890| 01 ac 00 00 00 00 00 00 | 00 00 00 00 00 00 01 00 |........|........|
|000008a0| 00 00 01 9c 00 00 00 9c | 00 00 00 66 00 f3 bf d8 |........|...f....|
|000008b0| 25 d4 00 00 00 1c 00 66 | 00 02 42 4b 50 54 00 00 |%......f|..BKPT..|
|000008c0| 00 1a 44 54 56 55 00 00 | 00 26 4d 50 53 52 00 01 |..DTVU..|.&MPSR..|
|000008d0| 00 32 28 f8 ff ff 00 00 | 00 00 00 00 00 00 22 42 |.2(.....|......"B|
|000008e0| ff ff 00 00 00 0e 00 00 | 00 00 03 ed ff ff 00 00 |........|........|
|000008f0| 00 2e 00 00 00 00 03 f0 | ff ff 00 00 00 7a 00 00 |........|.....z..|
|00000900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+